home *** CD-ROM | disk | FTP | other *** search
Java Source | 1998-06-30 | 1.9 KB | 66 lines |
- /*
- * @(#)ListModel.java 1.7 98/01/30
- *
- * Copyright (c) 1997 Sun Microsystems, Inc. All Rights Reserved.
- *
- * This software is the confidential and proprietary information of Sun
- * Microsystems, Inc. ("Confidential Information"). You shall not
- * disclose such Confidential Information and shall use it only in
- * accordance with the terms of the license agreement you entered into
- * with Sun.
- *
- * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
- * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
- * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
- * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
- * THIS SOFTWARE OR ITS DERIVATIVES.
- *
- */
-
- package com.sun.java.swing;
-
- /**
- * This interface defines the methods components like JList use
- * to get the value of each cell in a list and the length of the list.
- * Logically the model is a vector, indices vary from 0 to
- * ListDataModel.getSize() - 1. Any change to the contents or
- * length of the data model must be reported to all of the
- * ListDataListeners.
- *
- * @version 0.0 03/01/97
- * @author Hans Muller
- * @see JList
- */
-
- import com.sun.java.swing.event.ListDataListener;
-
-
- public interface ListModel
- {
- /**
- * Returns the length of the list.
- */
- int getSize();
-
- /**
- * Returns the value at the specified index.
- */
- Object getElementAt(int index);
-
- /**
- * Add a listener to the list that's notified each time a change
- * to the data model occurs.
- * @param l the ListDataListener
- */
- void addListDataListener(ListDataListener l);
-
- /**
- * Remove a listener from the list that's notified each time a
- * change to the data model occurs.
- * @param l the ListDataListener
- */
- void removeListDataListener(ListDataListener l);
- }
-
-